/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lt.ntec.danblog.server.blog.model.objectify;

import java.util.Date;
import lt.ntec.danblog.server.blog.model.BlogEntityFactory;
import lt.ntec.danblog.server.blog.model.Post;
import lt.ntec.danblog.server.core.model.Comment;
import lt.ntec.danblog.server.core.model.User;

/**
 *
 * @author Tadas Šubonis (tadas.subonis@affecto.com)
 */
public class ObjectifyEntityFactory implements BlogEntityFactory {
    
    @Override
    public Post createPost(User author, String urlString) {
        BlogPost blogPost =
                new BlogPost(author, urlString);
        
        blogPost.setDate(new Date());
        return blogPost;
    }

    @Override
    public Comment createComment(User user, Post parent) {
        return new BlogComment(user, parent);
    }

}
